/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * EvidencijaDolazaka.java
 *
 * Created on Jun 23, 2010, 7:38:38 PM
 */

package klijent.gui;

import klijent.kontrolerKI.KontrolerKIDolazak;
import klijent.kontrolerKI.KontrolerKIVezbac;

/**
 *
 * @author Porodica Ivic
 */
public class EvidencijaDolazaka extends javax.swing.JFrame {

    /** Creates new form EvidencijaDolazaka */
    public EvidencijaDolazaka() {
        initComponents();
        setLocationRelativeTo(null);
        setResizable(false);
        KontrolerKIDolazak.pripremiFormuEvidencijaDolazaka(jtVezbaci, jtDolasci, jlDanasnjiDatum, jbUbaciDolazak);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel2 = new javax.swing.JLabel();
        bgPronadji = new javax.swing.ButtonGroup();
        jLabel1 = new javax.swing.JLabel();
        jrbClBroj = new javax.swing.JRadioButton();
        jrbPrez = new javax.swing.JRadioButton();
        jtxtPronadji = new javax.swing.JTextField();
        jbPronadji = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        jScrollPane1 = new javax.swing.JScrollPane();
        jtVezbaci = new javax.swing.JTable();
        jbSelektujVezbaca = new javax.swing.JButton();
        jlblImePrezimeVezbaca = new javax.swing.JLabel();
        jlblTreningVezbaca = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jtDolasci = new javax.swing.JTable();
        jbUbaciDolazak = new javax.swing.JButton();
        jlDanasnjiDatum = new javax.swing.JLabel();
        jlVezbacID = new javax.swing.JLabel();
        jlSifraTreninga = new javax.swing.JLabel();
        jlBrojDolazaka = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();

        jLabel2.setText("jLabel2");

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Evidencija dolazaka");

        jLabel1.setFont(new java.awt.Font("Mangal", 0, 18));
        jLabel1.setText("Pronadji vezbaca:");

        bgPronadji.add(jrbClBroj);
        jrbClBroj.setText("po clanskom broju");

        bgPronadji.add(jrbPrez);
        jrbPrez.setText("po prezimenu");

        jbPronadji.setText("Pronadji");
        jbPronadji.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbPronadjiActionPerformed(evt);
            }
        });

        jtVezbaci.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(jtVezbaci);

        jbSelektujVezbaca.setText("Selektuj vezbaca");
        jbSelektujVezbaca.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbSelektujVezbacaActionPerformed(evt);
            }
        });

        jlblImePrezimeVezbaca.setBorder(new javax.swing.border.MatteBorder(null));

        jlblTreningVezbaca.setBorder(new javax.swing.border.MatteBorder(null));

        jtDolasci.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane2.setViewportView(jtDolasci);

        jbUbaciDolazak.setText("Ubaci novi dolazak");
        jbUbaciDolazak.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbUbaciDolazakActionPerformed(evt);
            }
        });

        jlDanasnjiDatum.setBorder(new javax.swing.border.MatteBorder(null));

        jlVezbacID.setBorder(new javax.swing.border.MatteBorder(null));

        jlBrojDolazaka.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        jlBrojDolazaka.setBorder(new javax.swing.border.MatteBorder(null));

        jLabel3.setText("dolazaka na ovoj kartici");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 268, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jrbPrez)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(jtxtPronadji, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jrbClBroj, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jbPronadji, javax.swing.GroupLayout.Alignment.LEADING)))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 246, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jbSelektujVezbaca))
                            .addGap(48, 48, 48))
                        .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 437, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jlDanasnjiDatum, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jlblTreningVezbaca, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)
                            .addComponent(jbUbaciDolazak, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addComponent(jlVezbacID, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jlblImePrezimeVezbaca, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jlSifraTreninga, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(39, 39, 39)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 324, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel3))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(50, 50, 50)
                                .addComponent(jlBrojDolazaka, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addGap(76, 76, 76))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jrbClBroj)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jrbPrez)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jtxtPronadji, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(13, 13, 13)
                        .addComponent(jScrollPane1, 0, 0, Short.MAX_VALUE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jbPronadji)
                    .addComponent(jbSelektujVezbaca))
                .addGap(31, 31, 31)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(13, 13, 13)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jlVezbacID, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jlblImePrezimeVezbaca, javax.swing.GroupLayout.DEFAULT_SIZE, 27, Short.MAX_VALUE))
                        .addGap(20, 20, 20)
                        .addComponent(jlblTreningVezbaca, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(28, 28, 28)
                        .addComponent(jbUbaciDolazak)
                        .addGap(29, 29, 29)
                        .addComponent(jlDanasnjiDatum, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(5, 5, 5)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel3)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jlBrojDolazaka, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jlSifraTreninga, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(95, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jbPronadjiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbPronadjiActionPerformed
        // TODO add your handling code here:
        KontrolerKIVezbac.pronadjiVezbace(jrbClBroj, jrbPrez, jtxtPronadji, jtVezbaci);
}//GEN-LAST:event_jbPronadjiActionPerformed

    private void jbSelektujVezbacaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbSelektujVezbacaActionPerformed
        // TODO add your handling code here:
        KontrolerKIDolazak.vratiSelektovanogVezbaca(jtVezbaci, jlblImePrezimeVezbaca, jlblTreningVezbaca, jlSifraTreninga, jlVezbacID, jtDolasci, jbUbaciDolazak, jlBrojDolazaka);
    }//GEN-LAST:event_jbSelektujVezbacaActionPerformed

    private void jbUbaciDolazakActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbUbaciDolazakActionPerformed
        // TODO add your handling code here:
        KontrolerKIDolazak.ubaciNoviDolazak(jlSifraTreninga, jlVezbacID, jlDanasnjiDatum, jtDolasci, jlBrojDolazaka, jlblTreningVezbaca);
    }//GEN-LAST:event_jbUbaciDolazakActionPerformed

    /**
    * @param args the command line arguments
    */
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup bgPronadji;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JButton jbPronadji;
    private javax.swing.JButton jbSelektujVezbaca;
    private javax.swing.JButton jbUbaciDolazak;
    private javax.swing.JLabel jlBrojDolazaka;
    private javax.swing.JLabel jlDanasnjiDatum;
    private javax.swing.JLabel jlSifraTreninga;
    private javax.swing.JLabel jlVezbacID;
    private javax.swing.JLabel jlblImePrezimeVezbaca;
    private javax.swing.JLabel jlblTreningVezbaca;
    private javax.swing.JRadioButton jrbClBroj;
    private javax.swing.JRadioButton jrbPrez;
    private javax.swing.JTable jtDolasci;
    private javax.swing.JTable jtVezbaci;
    private javax.swing.JTextField jtxtPronadji;
    // End of variables declaration//GEN-END:variables

}
